package test.generic;

import java.util.ArrayList;
import java.util.List;

import test.Hello;
import test.InnerClass;
import test.Tinterface;

public class GenericBase<T, U extends InnerClass.Inner&Tinterface&InterfaceGeneric<U, S>, S> {
	public GenericBase(){
		System.out.println("generic0");
	}
	String[] ss = new String[3];
T[] ts = (T[]) new Object[4];
	public T get(T t) {
		return t;
	}

	List<InnerClass.Inner> list = new ArrayList<>();
	public <X> void addd(List<? super X> x,X item){
		x.add(item);
		System.out.println(x.get(0));
	}
			public void ff(){
				addd(list, new Hello());
				System.out.println(list.get(0));
			}
	public String getu(U u) {
		return u.get();
	}
	public String gets(U u) {
		return u.gets(u);
	}
public U geth(U u){
	System.out.println(u.test());
	return u;
}
	public <U> String gett(U u){
		 return u.toString();
	 }
	public static void main(String[] args){
		GenericBase<String, Hello,Integer> gb = new GenericBase<>();
		Hello hello = new Hello(new InnerClass());
		System.out.println(gb.getu(hello));
		System.out.println(gb.get("gfg"));
		System.out.println(gb.gett(hello));
		System.out.println(gb.gets(hello));
		gb.ff();
		
	}
}





